<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>焦虑自评</title>
    <!-- 引入 vant UI 组件库样式文件 -->
    <link rel="stylesheet" href="../../../common/css/vant-index.css" />
    <style rel="stylesheet">
        body {
            background-color: #f7f8fa;
        }

        a {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }

        a:-webkit-any-link {
            color: #eee;
        }

        .container {
            border: 1px solid #f5f5f5;
            box-shadow: -1px 5px 5px #ececec;
            border-radius: 10px;
            margin: 0.6rem;
            padding: 0;
        }

        .van-cell__title {
            flex: 2;
        }

        #lists {
            margin-top: 0.2rem;
            font-size: 1rem;
            font-weight: 350;
            color: #8c8b8c;
            text-align: left;
        }

        .van-cell-group--inset {
            margin: 0;
        }

        .tab-btn {
            margin: 0.2rem;
            height: 1.7rem;
            line-height: 1.7rem;
        }

        #tabs-title {
            background-color: #11428c;
            display: flex;
        }

        #left-btn {
            flex: 1;
        }

        #right-btn {
            margin-right: 0.5rem;
        }


        .evalution_value {
            height: 3rem;
            width: 100%;
            background-color: #E22E30;
            text-align: center;
            line-height: 3rem;
            bottom: 0;
            margin-top: 3rem;
            margin-bottom: 0.5rem;
        }

        .van-button::before {
            background-color: red;
        }

        .evalution_button {
            margin: 0.2rem 0.2rem;
        }

        .evalution_button_list {
            margin: 0.2rem 0.2rem;
            width: 45%;
        }

        .bgcolor {
            background-color: #E22E30;
            color: #fff;
        }
		
		.bgcolorred {
		    background-color: #E22E30;
		    color: #fff;
		}
		.bgcolorblue {
		    background-color: #005BAC;
		    color: #fff;
		}
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <van-nav-bar v-if='from!="weapp"' title="焦虑自评" left-text="返回" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
            <template #right>
                <van-icon name="wap-home-o" size='18' />
            </template>
        </van-nav-bar>
        <div class="container" :class="from=='weapp'?'padding-bottom':''">
            <span>1.我觉得比平时容易紧张和着急（焦虑）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio1=1,getButtonChange(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio1=2,getButtonChange(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio1=3,getButtonChange(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio1=4,getButtonChange(4)">总是
                </van-button>

            </div>
            <span>2.我无缘无故的感到害怕（害怕）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod1==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio2=1,getButtonChange1(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod1==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio2=2,getButtonChange1(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod1==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio2=3,getButtonChange1(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod1==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio2=4,getButtonChange1(4)">总是
                </van-button>

            </div>
            <span>3.我很容易心里烦乱或觉得惊恐（惊恐）。
            </span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod2==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio3=1,getButtonChange2(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod2==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio3=2,getButtonChange2(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod2==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio3=3,getButtonChange2(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod2==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio3=4,getButtonChange2(4)">总是
                </van-button>

            </div>
            <span>4.我觉得我可能将要发疯（发疯感）。

            </span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod3==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio4=1,getButtonChange3(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod3==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio4=2,getButtonChange3(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod3==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio4=3,getButtonChange3(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod3==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio4=4,getButtonChange3(4)">总是
                </van-button>

            </div>
            <span>5.我觉得一切都很好，也不会发生什么不幸（不幸预感）</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod4==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio5=1,getButtonChange4(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod4==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio5=2,getButtonChange4(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod4==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio5=3,getButtonChange4(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod4==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio5=4,getButtonChange4(4)">总是
                </van-button>

            </div>
            <span>6.我手脚发抖打颤（手足颤抖）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod5==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio6=1,getButtonChange5(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod5==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio6=2,getButtonChange5(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod5==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio6=3,getButtonChange5(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod5==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio6=4,getButtonChange5(4)">总是
                </van-button>

            </div>
            <span>7.我因为头痛、颈痛和背痛而苦恼（躯体疼痛）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod6==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio7=1,getButtonChange6(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod6==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio7=2,getButtonChange6(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod6==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio7=3,getButtonChange6(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod6==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio7=4,getButtonChange6(4)">总是
                </van-button>

            </div>
            <span>8.我感觉容易衰弱和疲乏（乏力）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod7==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio8=1,getButtonChange7(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod7==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio8=2,getButtonChange7(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod7==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio8=3,getButtonChange7(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod7==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio8=4,getButtonChange7(4)">总是
                </van-button>


            </div>
            <span>9.我觉得心平气和，并且容易安静坐着（静坐不能）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod8==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio9=1,getButtonChange8(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod8==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio9=2,getButtonChange8(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod8==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio9=3,getButtonChange8(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod8==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio9=4,getButtonChange8(4)">总是
                </van-button>

            </div>
            <span>10.我觉得心跳的快（心悸）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod9==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio10=1,getButtonChange9(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod9==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio10=2,getButtonChange9(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod9==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio10=3,getButtonChange9(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod9==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio10=4,getButtonChange9(4)">总是
                </van-button>

            </div>
            <span>11.我因为一阵阵头晕而苦恼（头昏）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod10==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio11=1,getButtonChange10(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod10==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio11=2,getButtonChange10(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod10==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio11=3,getButtonChange10(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod10==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio11=4,getButtonChange10(4)">总是
                </van-button>

            </div>
            <span>12.我有晕倒发作，或觉得要晕倒似的（晕厥感）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod11==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio12=1,getButtonChange11(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod11==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio12=2,getButtonChange11(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod11==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio12=3,getButtonChange11(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod11==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio12=4,getButtonChange11(4)">总是
                </van-button>

            </div>
            <span>13.我呼气呼气都感到很容易（呼吸困难）。
            </span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod12==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio13=1,getButtonChange12(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod12==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio13=2,getButtonChange12(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod12==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio13=3,getButtonChange12(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod12==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio13=4,getButtonChange12(4)">总是
                </van-button>

            </div>
            <span>14.我手脚麻木和刺痛（手足刺痛）。

            </span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod13==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio14=1,getButtonChange13(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod13==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio14=2,getButtonChange13(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod13==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio14=3,getButtonChange13(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod13==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio14=4,getButtonChange13(4)">总是
                </van-button>
            </div>
            <span>15.我因胃痛和消化不良而苦恼（胃痛或消化不良）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod14==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio15=1,getButtonChange14(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod14==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio15=2,getButtonChange14(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod14==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio15=3,getButtonChange14(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod14==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio15=4,getButtonChange14(4)">总是
                </van-button>

            </div>
            <span>16.我常常要小便（尿意频数）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod15==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio16=1,getButtonChange15(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod15==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio16=2,getButtonChange15(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod15==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio16=3,getButtonChange15(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod15==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio16=4,getButtonChange15(4)">总是
                </van-button>

            </div>
            <span>17.我的手常常是干燥温暖的（多汗）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod16==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio17=1,getButtonChange16(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod16==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio17=2,getButtonChange16(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod16==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio17=3,getButtonChange16(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod16==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio17=4,getButtonChange16(4)">总是
                </van-button>

            </div>
            <span>18.我脸红发热（面部潮红）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod17==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio18=1,getButtonChange17(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod17==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio18=2,getButtonChange17(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod17==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio18=3,getButtonChange17(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod17==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio18=4,getButtonChange17(4)">总是
                </van-button>


            </div>
            <span>19.我容易入睡并且一夜睡得很好（睡眠障碍）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod18==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio19=1,getButtonChange18(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod18==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio19=2,getButtonChange18(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod18==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio19=3,getButtonChange18(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod18==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio19=4,getButtonChange18(4)">总是
                </van-button>

            </div>
            <span>20.我做恶梦（恶梦）。</span>
            <div class="evalution_button">
                <van-button round class="evalution_button_list" :class="statisticsPeriod19==1?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio20=1,getButtonChange19(1)">很少
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod19==2?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio20=2,getButtonChange19(2)">有时
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod19==3?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio20=3,getButtonChange19(3)">经常
                </van-button>
                <van-button round class="evalution_button_list" :class="statisticsPeriod19==4?(from=='weapp'?'bgcolorblue':'bgcolorred'):''"
                    @click="this.radios.radio20=4,getButtonChange19(4)">总是
                </van-button>

            </div>

            <div class="evalution_value" @click="postSas" v-if="status==true&&from==''">
                <span style="color: #f3f3f3;">提交问卷</span>
            </div>
			<div class="evalution_value" style="background-color: #005BAC;" @click="postSas" v-if="status==true&&from=='weapp'">
			    <span style="color: #f3f3f3;">提交问卷</span>
			</div>


        </div>
    </div>
</body>
<!-- 上线环境用 -->
<script src="../../../common/js/vue.global.prod.js"></script>
<!-- 引入 UI 组件库 -->
<script src="../../../common/js/vant.min.js"></script>
<!-- axios 接口调用 -->
<script src="../../../common/js/axios.min.js"></script>
<script src="../../../base.js"></script>
<script src="../../../common/js/url.min.js"></script>

<script type="module">

    import {
        getAction,
        postAction,
        getUrl,
    } from "../../../common/js/api/vue3-axios-utils.js";
    const PatientData = {
        data() {
            return {
                url: {
                    postSas: "/105/42/1054201",
                    getSasInfo: "/105/42/1054202",

                },

                status: true,
                currentData: {},
                statisticsPeriod: null,
                statisticsPeriod1: null,
                statisticsPeriod2: null,
                statisticsPeriod3: null,
                statisticsPeriod4: null,
                statisticsPeriod5: null,
                statisticsPeriod6: null,
                statisticsPeriod7: null,
                statisticsPeriod8: null,
                statisticsPeriod9: null,
                statisticsPeriod10: null,
                statisticsPeriod11: null,
                statisticsPeriod12: null,
                statisticsPeriod13: null,
                statisticsPeriod14: null,
                statisticsPeriod15: null,
                statisticsPeriod16: null,
                statisticsPeriod17: null,
                statisticsPeriod18: null,
                statisticsPeriod19: null,

                radios: {
                    radio1: null,
                    radio2: null,
                    radio3: null,
                    radio4: null,
                    radio5: null,
                    radio6: null,
                    radio7: null,
                    radio8: null,
                    radio9: null,
                    radio10: null,
                    radio11: null,
                    radio12: null,
                    radio13: null,
                    radio14: null,
                    radio15: null,
                    radio16: null,
                    radio17: null,
                    radio18: null,
                    radio19: null,
                    radio20: null,

                },
				patientId:'',
				from:''
            };
        },


        methods: {
            getButtonChange(value) {
                this.statisticsPeriod = value;
            },
            getButtonChange1(value) {
                this.statisticsPeriod1 = value;
            },
            getButtonChange2(value) {
                this.statisticsPeriod2 = value;
            },
            getButtonChange3(value) {
                this.statisticsPeriod3 = value;
            },
            getButtonChange4(value) {
                this.statisticsPeriod4 = value;
            },
            getButtonChange5(value) {
                this.statisticsPeriod5 = value;
            },
            getButtonChange6(value) {
                this.statisticsPeriod6 = value;
            },
            getButtonChange7(value) {
                this.statisticsPeriod7 = value;
            },
            getButtonChange8(value) {
                this.statisticsPeriod8 = value;
            },
            getButtonChange9(value) {
                this.statisticsPeriod9 = value;
            },
            getButtonChange10(value) {
                this.statisticsPeriod10 = value;
            },
            getButtonChange11(value) {
                this.statisticsPeriod11 = value;
            },
            getButtonChange12(value) {
                this.statisticsPeriod12 = value;
            },
            getButtonChange13(value) {
                this.statisticsPeriod13 = value;
            },
            getButtonChange14(value) {
                this.statisticsPeriod14 = value;
            },
            getButtonChange15(value) {
                this.statisticsPeriod15 = value;
            },
            getButtonChange16(value) {
                this.statisticsPeriod16 = value;
            },
            getButtonChange17(value) {
                this.statisticsPeriod17 = value;
            },
            getButtonChange18(value) {
                this.statisticsPeriod18 = value;
            },
            getButtonChange19(value) {
                this.statisticsPeriod19 = value;
            },
            onClickLeft() {
                window.location.href = './sasInfo.html'
            },
            onClickRight() {
                window.location.href = '../../index.html?userid=' + localStorage.pid
            },



            getPatientId() {
                let patientId = this.patientId
            },

            async postSas() {

                let inputs = [];
                for (let i in this.radios) {
                    inputs.push(this.radios[i]);

                }
                for (let k in inputs) {
                    if (inputs[k] == null) {
                        vant.Toast.fail('请填写所有选项!');
                    }
                    break
                }



                let url =
                    getUrl() + this.url.postSas;
				let patientId = this.patientId
                let params = {
                    // 患者 ID 从本地存储空间的 pid 获得
                    patientId: patientId,
                    answers: inputs

                };
                const res = await postAction(url, params);
                if (res.data.success) {
                    vant.Toast.success('3秒后查看结果');
                    // 定时跳转
					if(this.from){
						setTimeout("javascript:history.go( -1 )", 3000);
					}else{
						setTimeout("javascript:location.href='./sasInfo.html'", 3000);
					}
                    
                }
            },
        },
        created() {
			if(url('?from')=='weapp'){
				this.from = 'weapp'
			}
			if(url('?pid')){
				this.patientId = url('?pid')
			}else{
				this.patientId = localStorage.pid;
			}
            var status = window.location.search.slice(8,9)
            if (status == 1) {
                let patientId=this.patientId
                let params = {
                    patientId: patientId
                }


                let url =
                    getUrl() + this.url.getSasInfo;
                getAction(url, params).then((res) => {
                    console.log(res.data.result.answers);
                    this.statisticsPeriod = res.data.result.answers[0],
                        this.statisticsPeriod1 = res.data.result.answers[1],
                        this.statisticsPeriod2 = res.data.result.answers[2],
                        this.statisticsPeriod3 = res.data.result.answers[3],
                        this.statisticsPeriod4 = res.data.result.answers[4],
                        this.statisticsPeriod5 = res.data.result.answers[5],
                        this.statisticsPeriod6 = res.data.result.answers[6],
                        this.statisticsPeriod7 = res.data.result.answers[7],
                        this.statisticsPeriod8 = res.data.result.answers[8],
                        this.statisticsPeriod9 = res.data.result.answers[9],
                        this.statisticsPeriod10 = res.data.result.answers[10],
                        this.statisticsPeriod11 = res.data.result.answers[11],
                        this.statisticsPeriod12 = res.data.result.answers[12],
                        this.statisticsPeriod13 = res.data.result.answers[13],
                        this.statisticsPeriod14 = res.data.result.answers[14],
                        this.statisticsPeriod15 = res.data.result.answers[15],
                        this.statisticsPeriod16 = res.data.result.answers[16],
                        this.statisticsPeriod17 = res.data.result.answers[17],
                        this.statisticsPeriod18 = res.data.result.answers[18],
                        this.statisticsPeriod19 = res.data.result.answers[19],
                        this.status = false


                })



            }
            this.getPatientId()
        },

    };

    const app = Vue.createApp(PatientData);

    app.use(vant);
    // 通过 CDN 引入时不会自动注册 Lazyload 组件
    // 可以通过下面的方式手动注册
    app.use(vant.Lazyload);

    // 调用函数组件，弹出一个 Toast
    // vant.Toast("刷新成功");
    app.mount("#app");
</script>

</html>
